﻿#include "liboai.h"

using namespace liboai;

int main() {
    OpenAI oai;

    // create a conversation
    Conversation convo;

    // add a message to the conversation
    convo.AddUserData("hello");


    if (oai.auth.SetKeyEnv("OPENAI_API_KEY")) {
        try {
            Response response = oai.ChatCompletion->create(
                "gpt-3.5-turbo", convo
            );

            // update our conversation with the response
            convo.Update(response);

            // print the response
            std::cout << convo.GetLastResponse() << std::endl;
        }
        catch (std::exception& e) {
            std::cout << e.what() << std::endl;
        }
    }
}
